home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 17 / CU Amiga Magazine's Super CD-ROM 17 (1997)(EMAP Images)(GB)[!][issue 1997-12].iso / CUCD / Programming / Gui4Cli / Tools / fastread / MakeDoc.gc < prev    next >
Encoding:
Gui4CLI script  |  1980-01-03  |  3.5 KB  |  193 lines

  1. G4C
  2.  
  3. ; A document assembler for the Gui4Cli FastRead help system.
  4.  
  5. winbig -1 -1 360 139 "MakeDoc © G.Maddox 1997"
  6. winsmall -1 -1 360 139
  7. wintype 11110001
  8. varpath ""
  9.  
  10. xonload
  11. set output "con:100/75/440/100/MakeDoc Output/auto"
  12. ifexists file c:type
  13.     ;Nop
  14. else
  15.     ezreq "I need the TYPE command in C:" Okay ""
  16.     guiquit makedoc.gc
  17. endif
  18. guiopen makedoc.gc
  19. setgad makedoc.gc 3 on
  20. setgad makedoc.gc 4 off
  21.  
  22. xonclose
  23. ifexists file env:dbname
  24.     delete env:dbname
  25. endif
  26. guiquit makedoc.gc
  27.  
  28. xlistview 0 39 180 100 "" srcefile "" 0 dir
  29. gadid 1
  30. gadfont topaz.font 8 000
  31. lvdirhook 1
  32. extract srcefile file srcefile
  33. lvuse makedoc.gc 2
  34. lvadd $srcefile
  35.  
  36. xlvdirhook 1
  37. cd $$lv.dir
  38.  
  39. xlistview 180 39 180 100 "" "" "" 0 txt
  40. gadid 2
  41. gadfont topaz.font 8 000
  42.  
  43. xbutton 0 0 70 13 Outfile
  44. reqfile -1 -1 240 -60 "Select Output File" save outfile SYS:
  45. if $outfile > ""
  46.     gosub makedoc.gc checkexist
  47.     extract outfile file dbtitle
  48.     update makedoc.gc 3 $outfile
  49.     setgad makedoc.gc 4 on
  50. else
  51.     setgad makedoc.gc 3 on
  52. endif
  53.  
  54. xtextin 70 0 290 13 "" outfile "" 512
  55. gadid 3
  56. if $outfile = ""
  57.     ezreq "You MUST supply a\ntarget path/filename!" Okay ""
  58.     setgad makedoc.gc 3 on
  59. else
  60.     gosub makedoc.gc checkexist
  61.     extract outfile file dbtitle
  62.     setgad makedoc.gc 4 on
  63. endif
  64.  
  65. xbutton 0 13 60 13 Volume
  66. lvuse makedoc.gc 1
  67. lvdir disks
  68.  
  69. xbutton 60 13 60 13 Root
  70. lvuse makedoc.gc 1
  71. lvdir root
  72.  
  73. xbutton 120 13 60 13 Parent
  74. lvuse makedoc.gc 1
  75. lvdir parent
  76.  
  77. xbutton 0 26 60 13 All
  78. lvuse makedoc.gc 1
  79. lvdir all
  80.  
  81. xbutton 60 26 60 13 None
  82. lvuse makedoc.gc 1
  83. lvdir none
  84.  
  85. xbutton 120 26 60 13 Xfer
  86. gosub makedoc.gc nofile
  87. while $srcefile > ""
  88.     ifexists dir $srcefile
  89.         lvmulti off
  90.         lvmulti next
  91.     else
  92.         extract srcefile file srcefile
  93.         lvuse makedoc.gc 2
  94.         lvadd $srcefile
  95.         lvuse makedoc.gc 1
  96.         lvmulti off
  97.         lvmulti next
  98.     endif
  99. endwhile
  100.  
  101. xbutton 180 13 60 13 Clear
  102. lvuse makedoc.gc 2
  103. lvclear
  104.  
  105. xbutton 240 13 60 13 _Up
  106. lvuse makedoc.gc 2
  107. if $$lv.line > 0
  108.     dummy1 = $$lv.rec
  109.     lvgo prev
  110.     dummy2 = $$lv.rec
  111.     lvput $dummy1
  112.     lvgo next
  113.     lvput $dummy2
  114.     lvgo prev
  115. endif
  116.  
  117. ;-------------------- 
  118.  
  119. xbutton 300 13 60 13 Start
  120. gadid 4
  121. ..dbname = '@database $dbtitle\n@Node main \"$dbtitle\"\n\nNODES :\n\n'
  122. cli 'c:type env:dbname to $outfile'
  123. lvuse makedoc.gc 2
  124. lvgo first
  125. guiwindow makedoc.gc wait
  126.  
  127. ;--- make main node page - to make it AmigaGuide compatible
  128. while $$lv.line > ""
  129.      append $outfile '\t@{\" $$lv.rec \" link \"$$lv.rec\"} \n'
  130.      lvgo next
  131. endwhile
  132. append $outfile '\n@endnode\n'
  133.  
  134. ;---- join the files
  135. lvgo first
  136. while $$lv.line > ""
  137.      append $outfile '\n@node \"$$lv.rec\"\n\n'
  138.      cli 'c:type $$lv.rec >>$outfile'
  139.      append $outfile '\n@endnode\n'
  140.      lvgo next
  141. endwhile
  142.  
  143. guiwindow makedoc.gc resume
  144. lvclear
  145. delvar outfile
  146. update makedoc.gc 3 ""
  147. setgad makedoc.gc 4 off
  148.  
  149. ;--------------- 
  150.  
  151.  
  152. xbutton 180 26 60 13 Remove
  153. lvuse makedoc.gc 2
  154. lvdel -1
  155.  
  156. xbutton 240 26 60 13 _Down
  157. lvuse makedoc.gc 2
  158. numlines = $$lv.total
  159. counter numlines dec 1
  160. if $$lv.line < $numlines
  161.     dummy1 = $$lv.rec
  162.     lvgo next
  163.     dummy2 = $$lv.rec
  164.     lvput $dummy1
  165.     lvgo prev
  166.     lvput $dummy2
  167.     lvgo next
  168. endif
  169.  
  170. xbutton 300 26 60 13 Quit
  171. guiclose makedoc.gc
  172.  
  173. xroutine nofile
  174. lvuse makedoc.gc 1
  175. lvmulti first
  176. if $srcefile = ""
  177.     ezreq "No Files Selected" Okay ""
  178.     stop
  179. endif
  180.  
  181. xroutine checkexist
  182. ifexists file $outfile
  183.     ezreq "File already exists. If you\nproceed it will be appended to." Append|Cancel opt
  184.     if $opt = 1
  185.         return
  186.     else
  187.         delvar outfile
  188.         update makedoc.gc 3 ""
  189.         setgad makedoc.gc 4 off
  190.         stop
  191.     endif
  192. endif
  193.